package be.rhok.eenzaamheidswijzer.model;

import org.hibernate.annotations.Fetch;
import org.hibernate.annotations.FetchMode;

import javax.persistence.*;

@Entity
@Table(name = "EW_ANSWER", schema = "RHOK")
public class Answer {
    @Id
    private long id;

    @ManyToOne
    @Fetch(FetchMode.JOIN)
    @JoinColumn(name = "next_question_id", nullable = true)
    private Question nextQuestion;

    @ManyToOne
    @Fetch(FetchMode.JOIN)
    @JoinColumn(name = "solution_id", nullable = true)
    private Solution solution;

    @Column(length = 10000)
    private String dutchValue;

    @OrderBy
    private Integer sortNr;

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }


    public String getDutchValue() {
        return dutchValue;
    }

    public void setDutchValue(String dutchValue) {
        this.dutchValue = dutchValue;
    }

    public Question getNextQuestion() {
        return nextQuestion;
    }

    public void setNextQuestion(Question nextQuestion) {
        this.nextQuestion = nextQuestion;
    }

    public Solution getSolution() {
        return solution;
    }

    public void setSolution(Solution solution) {
        this.solution = solution;
    }

    public Integer getSortNr() {
        return sortNr;
    }

    public void setSortNr(Integer sortNr) {
        this.sortNr = sortNr;
    }
}